<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Zipow Chat Test</title>
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <style type="text/css">
        body
        {
            text-align: center;
            margin: 10px;
            margin-bottom: 50px;
            padding: 0;
        }
        iframe
        {
            width:100%;
            border: 1px solid red;
        }
    </style>
    <script type="text/javascript">
        $(function () {

            function changeIFrameSize() {
                $('#mainframe').height($(window).height() - 20 - 2 - 50);
            }

            $(window).resize(function () {
                changeIFrameSize();
            });


            var itemIndex = 0;


            $('#btnAddMessage').click(function () {
                var addMessage = window.frames[0].AddTextMsgItem;

                var id = itemIndex++, senderName = "Sanshi Zhang", isSelf = true,
                senderPicUrl = "./photo/user.png", 
				message = "This is a message http://www.baidu.com/ bla blahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.for literally hundreds of controls and although the controls are usually pretty darn cool, sometimes I spot some snippets code that just don't look right. That is, they don't look right to me. I'm sure they look right to whoever wrote them.",
                timeStr = new Date().getTime() + '';
				
				//message = "hjkshadkjshjk";

                if (Math.random() > 0.5) {
                    senderName = "Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li Flyer Li";
                    isSelf = false;
                    senderPicUrl = "./photo/user.png";
                    message = "An incoming message.";
                }


                addMessage(id, senderName, isSelf, senderPicUrl, message, timeStr);

            });
			
			
			$('#btnClearAll').click(function () {
				var clearAll = window.frames[0].ClearAll;
				
				clearAll();
			});


            changeIFrameSize();
        });
    </script>
</head>
<body>
    <iframe id="mainframe" scrolling="no" src="chat_inmeeting.html"></iframe>
    <input id="btnAddMessage" type="button" value="Add Message" />
	<input id="btnClearAll" type="button" value="Clear All" />
</body>
</html>
